<template>
  <el-dialog
    title="查看流程"
    :visible.sync="dialogVisible"
    :append-to-body="true"
    :close-on-click-modal="false"
    @close="handleColse"
    width="40%"
  >
    <div class="block">
      <el-timeline>
        <el-timeline-item
          v-for="(activity, index) in dataForm"
          :key="index"
          :size="activity.size"
          :timestamp="activity.createTime">
          {{activity.statement}}
        </el-timeline-item>
      </el-timeline>
<!--    <el-timeline v-for="item in dataForm" :key="item.id" style="max-height: 400px">-->
<!--      <el-timeline-item :timestamp="item.createTime" placement="top">-->
<!--        <el-card>-->
<!--          <p>{{item.statement}}</p>-->
<!--        </el-card>-->
<!--      </el-timeline-item>-->
<!--    </el-timeline>-->
  </div>
    <div slot="footer" class="dialog-footer">
      <el-button
        @click="dialogVisible = false"
        size="small">取消</el-button>
    </div>
  </el-dialog>
</template>
<script>
  import {progressDetails} from '@/api/dailyweekly/workflow'
  export default {
    data() {
      return {
        dialogVisible: false,
        dialogLoading: false,
        dataForm: [],
        isShowToolbar: false,
        isDisabled: false,
        time: ''
      }
    },
    methods: {
      init (val, isDisabled) {
        this.isDisabled = isDisabled
        this.time = val
        this.dialogVisible = true
        this.dataForm = []
        this.$nextTick(() => {
          this.queryDaily()
        })
      },
      async queryDaily () {
        const parms = {
          date: this.time
        }
        console.log(parms, 'parms')
        const data = await progressDetails(parms)
        if (data) {
          if (data.code === 200) {
            this.dataForm = data.data
          }
        } else {
          this.dataForm = []
        }
        this.dialogLoading = false
      },
      handleSubmitForm () {
        this.dialogLoading = true
        this.editDaily()
      },
      onEditorChange (val) {
        this.dataForm.contentXml = val.html
      },
      handleColse () {
        this.dialogVisible = false
      }
    }
  }
</script>
<style scoped>
</style>
